<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
%>
<jsp:include page="/manage/inc/header.jsp"></jsp:include>
<jsp:include page="/manage/inc/menu.jsp"></jsp:include>

<!--/sidebar-->
<div class="main-wrap">

	<div class="crumb-wrap">
		<div class="crumb-list">
			<i class="icon-font"></i> <a href="<%=path%>/manage/index.jsp">首页</a><span
				class="crumb-step">&gt;</span> <a class="crumb-name"
				href="<%=path%>/manage/OfficialNewsServlet?action=list">通知管理</a><span
				class="crumb-step">&gt;</span><span>发送通知</span>
		</div>
	</div>
	<div class="result-wrap">
		<div class="result-content">
			<form action="<%=path%>/manage/OfficialNewsServlet?action=insert"
				method="post" id="myform" name="myform">
				<table class="insert-tab" width="100%">
					<tr>
						<th width="100"><i class="require-red">*</i>标题：</th>
						<td><input name="title" id="title" type="text"> <span
							id="titleMsg"></span></td>
					</tr>
					<tr>
						<th>内容：</th>
						<td><textarea name="content" class="common-textarea"
								id="content" cols="80" rows="10"></textarea> <span
							id="contentMsg"></span></td>
					</tr>
					<tr>
						<th></th>
						<td><input class="btn btn-primary btn6 mr10" id="subBtn"
							value="发送" type="button"> 
							<input class="btn btn6" value="返回" type="reset"></td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</div>
<!--/main-->
</div>
<jsp:include page="/manage/inc/footer.jsp"></jsp:include>
<script>
	$(function() {
		
		
		$("#title").blur(function() {

			var title = $.trim($("#title").val());
			if (title.length < 2) {
				$("#titleMsg").html("标题长度不能少于2个字符");
				$("#title").select();
				return;
			} else {
				$("#titleMsg").empty();
			}
		})
		$("#content").blur(function() {
			
		var description = $.trim($("#content").val());
		if (description.length < 4) {
			$("#contentMsg").html("简介的长度不少于4个字符");
			$("#content").select();
			return;
		} else {
			$("#contentMsg").html("");
		}
		})

		//提交按钮
		$("#subBtn").click(function() {
			var title = $.trim($("#title").val());
			if (title.length < 2) {
				$("#titleMsg").html("标题长度不能少于2个字符");
				$("#title").select();
				return;
			} else {
				$("#titleMsg").empty();
			}
			var content = $.trim($("#content").val());
			if (content.length < 4) {
				$("#contentMsg").html("简介的长度不少于4个字符");
				$("#content").select();
				return;
			} else {
				$("#contentMsg").html("");
			}

			$("#myform").submit();
		})
	})
</script>